package com.qjdchina.sku.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qjdchina.commons.result.Result;
import com.qjdchina.sku.biz.HardcoverStandardManager;
import com.qjdchina.sku.dao.mapper.HardcoverStandardMapper;
import com.qjdchina.sku.model.Category;
import com.qjdchina.sku.model.HardcoverStandard;
@Service
public class HardcoverStandardManagerImpl implements HardcoverStandardManager{
	
	@Autowired
	private HardcoverStandardMapper hardcoverStandardMapper;
	
	/**
	 * 获取精装标准
	 * shenpingfeng
	 * 2017年1月5日
	 * @return
	 */
	@Override
	public Result<List<HardcoverStandard>> getAllHardcoverStandard(){
		List<HardcoverStandard> hardcoverStandards = hardcoverStandardMapper.selectAllHardcoverStandard();
		return new Result<List<HardcoverStandard>>(hardcoverStandards);
	}
	/**
	 * 
	 * 获取品类ID
	 * 2017年1月5日
	 * @param hardcoverStandardId
	 * @return
	 */
	@Override
	public Result<List<Integer>> getCategoryIdByHardcoverStandardId(Integer hardcoverStandardId){
		List<Integer> hardcoverStandardIds  = hardcoverStandardMapper.selectCategoryIdByHardcoverStandardId(hardcoverStandardId);
		return new Result<List<Integer>>(hardcoverStandardIds);
	}
	
	/**
	 * 获取品类
	 * shenpingfeng
	 * 2017年1月5日
	 * @param hardcoverStandardId
	 * @return
	 */
	@Override
	public Result<List<Category>> getCategoryByHardcoverStandardId(Integer hardcoverStandardId){
		List<Category> categories  = hardcoverStandardMapper.selectCategoryByHardcoverStandardId(hardcoverStandardId);
		return new Result<List<Category>>(categories);
	}
	

}
